﻿
CREATE PROCEDURE [dbo].[proc_App_Roles_Create]
	(
		@RName nvarchar(50),
		@RNote nvarchar(256),
		@FAdminFlg BIT,
		@EntryPeople varchar(50)
	)
AS
BEGIN
	declare @ename NVARCHAR(20)
	set @ename = (SELECT EName FROM Employee WHERE UserName=@EntryPeople)
	IF(@ename is NULL)
	set @ename=@EntryPeople
	INSERT INTO App_Roles(RName,EntryPeople,RNote,FAdminFlg)
     VALUES (@RName,@ename,@RNote,@FAdminFlg)	
end
	RETURN

